import { Space } from 'antd'

export default function PlayName({ nickName, ballColor }: { nickName: string, ballColor: number }) {
  const str1 = (ballColor & 0xff).toString(16).padStart(2,"0")
  const str2 = (ballColor >> 8 & 0xff).toString(16).padStart(2,"0")
  const str3 = (ballColor >> 16 & 0xff).toString(16).padStart(2,"0")
  const backgroundColor = '#' + str3 + str2 + str1
  return (
    <Space>
      <span>{nickName}</span>
      <div style={{ width: 15, height: 15, borderRadius: '50%', backgroundColor }}></div>
    </Space>
  )
}
